#ifndef lint
static const char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
#endif

#include <stdlib.h>
#include <string.h>

#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define YYPATCH 20070509

#define YYEMPTY (-1)
#define yyclearin    (yychar = YYEMPTY)
#define yyerrok      (yyerrflag = 0)
#define YYRECOVERING (yyerrflag != 0)

extern int yyparse(void);

static int yygrowstack(void);
#define YYPREFIX "yy"
#line 2 "./CSSParser/src/CSSGrammer.ypp"
	#include <stdio.h>
	#include <assert.h>
	#include <ctype.h>

	#include "ChildCondition.h"
	#include "ChildSelector.h"
	#include "DocumentHandler.h"
	#include "LexicalUnit.h"
	#include "LexicalUnitImpl.h"
	#include "SelectorList.h"
	#include "SelectorListImpl.h"
	#include "DocumentHandler.h"

	/*#define YYDEBUG 1*/

	extern DocumentHandler* g_Handler;
	extern SelectorFactory* g_SelectorFactory;
	extern ConditionFactory* g_ConditionFactory;
	extern DocumentHandler* g_DocumentHandler;

	int yylex();
	extern void yyerror(char* error_str);

	int HexToInt(char c)
	{
		int result = -1;
		if(c >= '0' && c <='9')
			result = c - '0';
		else if(c >= 'a' && c <= 'f')
			result = c - 'a' + 10;
		return result;
	}

#line 38 "./CSSParser/src/CSSGrammer.ypp"
typedef union{
	char* text;
	int int_value;
	bool boolean;
	float float_value;

	LexicalUnit* iUnit;
	Condition* iCondition;
	ElementSelector* iElement;
	Selector* iSelector;
	SelectorList* iSelectorList;
} YYSTYPE;
#line 70 "./CSSParser/src/CSSGrammer.cc"
#define S 257
#define CDO 258
#define CDC 259
#define INCLUDES 260
#define DASHMATCH 261
#define STRING 262
#define INVALID 263
#define IDENT 264
#define HASH 265
#define IMPORT_SYM 266
#define PAGE_SYM 267
#define MEDIA_SYM 268
#define CHARSET_SYM 269
#define IMPORTANT_SYM 270
#define EMS 271
#define EXS 272
#define PXS 273
#define CMS 274
#define MMS 275
#define INS 276
#define PTS 277
#define PCS 278
#define DEGS 279
#define RADS 280
#define GRADS 281
#define MSECS 282
#define SECS 283
#define HERZS 284
#define KHERZS 285
#define DIMENSION 286
#define PERCENTAGE 287
#define NUMBER 288
#define URI 289
#define FUNCTION 290
#define YYERRCODE 256
short yylhs[] = {                                        -1,
    0,    0,    0,   21,   21,   23,   20,   19,   19,   16,
   16,   18,   17,   17,   17,   17,   15,   15,   15,   13,
   13,   12,   12,   12,   12,   14,   14,   11,    9,   10,
   10,    7,    7,    7,    6,    6,   24,   24,   25,   25,
    5,    4,    4,    2,    2,    3,    3,    3,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    8,   22,
   22,
};
short yylen[] = {                                         2,
    2,    2,    0,    1,    3,    4,    2,    1,    4,    2,
    2,    2,    1,    1,    2,    3,    1,    2,    1,    1,
    2,    1,    1,    1,    1,    1,    1,    2,    2,    5,
    9,    1,    1,    1,    1,    1,    1,    4,    5,    4,
    2,    2,    0,    1,    3,    2,    2,    0,    2,    2,
    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
    2,    2,    2,    2,    2,    2,    2,    1,    2,    0,
    2,
};
short yydefred[] = {                                      0,
    0,    0,   26,   22,   27,    0,   70,    0,   25,   24,
   23,   20,    0,    0,   13,    0,    0,    0,   70,   70,
    4,    2,   29,   28,    0,   21,    0,   12,   70,   70,
    0,   15,    7,   70,    0,    0,   71,   70,    0,    0,
   16,    0,   70,    0,    0,   37,    5,    0,    0,    0,
   70,    6,   70,   33,   34,   30,   32,   70,    0,    0,
    0,   40,   70,   70,   70,   70,   70,   70,   70,   70,
   70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
   70,   70,   44,    0,   68,   38,   36,   35,   70,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,   70,
   70,   70,    0,   39,    0,    0,    0,    0,   45,   31,
};
short yydgoto[] = {                                       8,
   83,   84,  113,  114,   44,   89,   58,   85,    9,   10,
   11,   12,   13,   14,   15,   31,   16,   17,   18,   19,
   20,   25,   21,   45,   46,
};
short yysindex[] = {                                    -41,
  -88, -228,    0,    0,    0, -226,    0,    0,    0,    0,
    0,    0,  -23,  -23,    0,   24,  -13,  -31,    0,    0,
    0,    0,    0,    0, -237,    0,  -23,    0,    0,    0,
  -13,    0,    0,    0, -232,  101,    0,    0, -216, -216,
    0,  101,    0,  -14,  -49,    0,    0,  -59,   24, -216,
    0,    0,    0,    0,    0,    0,    0,    0,  960, -232,
 -238,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  -38,    0,    0,    0,    0,    0, -216,
 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
 -216, -216, -216, -216, -216, -216, -216, -216, -216,    0,
    0,    0,  988,    0,  -89, -216, -216, -216,    0,    0,
};
short yyrindex[] = {                                     42,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,  -32,   -4,    0,  -28,    3,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   31,    0,    0,    0,
    0,    0,    0,    0,    0,   48,    0,    0,   15,   43,
    0,    0,    0,    0,    0,    0,    0,    0,  -26,   -7,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  719,    0,    0,    0,    0,    0,  -44,
  -16,   12,   40,   68,   97,  125,  153,  399,  427,  455,
  483,  511,  540,  568,  596,  842,  870,  898,  926,    0,
    0,    0,    0,    0,    0,  -45, 1016, 1044,    0,    0,
};
short yygindex[] = {                                      0,
  -64,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   -6,   38,    0,   -9,    0,   11,    0,    0,    0,
    0,  990,   18,    0,   -5,
};
#define YYTABLESIZE 1333
short yytable[] = {                                      65,
    5,   57,   65,  120,    6,  111,   26,   32,  112,   53,
   19,   19,   34,   42,   65,    8,    2,    9,   37,   37,
   26,   41,    6,   87,   37,   88,   38,   66,    5,   19,
   66,   43,    6,   56,    2,   23,   22,   24,   17,   17,
   37,    3,   66,   51,    2,   14,   14,    1,  119,    7,
   41,   27,   49,   47,   86,   69,   10,   17,   69,    0,
   10,    0,    0,    0,   14,    0,   29,    7,    0,    0,
   69,    0,   10,   18,   18,   52,    0,    7,    0,   42,
   65,    0,    0,   56,   11,   30,   56,    0,   11,    0,
   19,   33,   18,    0,    8,    0,    9,    0,   56,    0,
   11,    0,    0,    0,    0,   10,    0,    0,   66,    0,
    0,   57,    0,    0,   57,    0,    0,    0,   17,    0,
    0,    0,    0,    0,    0,   14,   57,    0,    0,    0,
    0,    0,    0,   11,    0,    0,   69,    0,    0,    0,
   55,    0,    5,   55,    0,    0,    6,    0,    0,    0,
    0,    0,    0,   18,    0,   55,    0,    0,    2,    0,
    0,    0,    0,    0,   56,    0,    0,   37,   52,    0,
    0,   52,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,   52,    0,    0,    0,    0,    0,    0,
    0,    7,   57,    0,    0,    0,   53,   37,    0,   53,
   54,   55,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   53,    0,    0,    1,    0,    0,   65,    0,   65,
   65,   55,    3,    4,   19,   65,   65,   65,   65,   65,
   65,  110,   65,   65,   65,   65,   65,   65,   65,   65,
   65,    4,   65,   65,   65,   66,    0,   66,   66,   52,
    3,    4,   17,   66,   66,   66,   66,   66,   66,   14,
   66,   66,   66,   66,   66,   66,   66,   66,   66,    0,
   66,   66,   66,   69,    0,   69,   69,   53,   10,   10,
   28,   69,   69,   69,   69,   69,   69,   18,   69,   69,
   69,   69,   69,   69,   69,   69,   69,    0,   69,   69,
   69,   56,    0,   56,   56,    0,   11,   11,    0,   56,
   56,   56,   56,   56,   56,    0,   56,   56,   56,   56,
   56,   56,   56,   56,   56,    0,   56,   56,   56,   57,
    0,   57,   57,    0,    0,    0,    0,   57,   57,   57,
   57,   57,   57,    0,   57,   57,   57,   57,   57,   57,
   57,   57,   57,    0,   57,   57,   57,   37,   55,    0,
   55,   55,    0,    0,    3,    4,   55,   55,   55,   55,
   55,   55,    0,   55,   55,   55,   55,   55,   55,   55,
   55,   55,    0,   55,   55,   55,   52,    0,   52,   52,
    0,    0,    0,    0,   52,   52,   52,   52,   52,   52,
    0,   52,   52,   52,   52,   52,   52,   52,   52,   52,
    0,   52,   52,   52,   53,    0,   53,   53,    0,    0,
    0,    0,   53,   53,   53,   53,   53,   53,    0,   53,
   53,   53,   53,   53,   53,   53,   53,   53,    0,   53,
   53,   53,   51,    0,    0,   51,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,   51,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
   54,    0,    0,   54,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,   54,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,   58,    0,
    0,   58,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,   58,    0,    0,    0,    0,    0,    0,
    0,    0,    0,   51,    0,    0,   59,    0,    0,   59,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   59,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   54,    0,    0,   60,    0,    0,   60,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,   60,
    0,    0,    0,    0,    0,    0,    0,    0,    0,   58,
    0,    0,    0,   61,    0,    0,   61,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,   61,    0,
    0,    0,    0,    0,    0,    0,    0,   59,    0,    0,
    0,   62,    0,    0,   62,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   62,    0,    0,    0,
    0,    0,    0,    0,    0,   60,    0,    0,    0,   63,
    0,    0,   63,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,   63,    0,    0,    0,    0,    0,
   51,    0,   51,   51,   61,    0,    0,    0,   51,   51,
   51,   51,   51,   51,    0,   51,   51,   51,   51,   51,
   51,   51,   51,   51,    0,   51,   51,   51,   54,    0,
   54,   54,   62,    0,    0,    0,   54,   54,   54,   54,
   54,   54,    0,   54,   54,   54,   54,   54,   54,   54,
   54,   54,    0,   54,   54,   54,   58,    0,   58,   58,
   63,    0,    0,    0,   58,   58,   58,   58,   58,   58,
    0,   58,   58,   58,   58,   58,   58,   58,   58,   58,
    0,   58,   58,   58,   59,    0,   59,   59,    0,    0,
    0,    0,   59,   59,   59,   59,   59,   59,    0,   59,
   59,   59,   59,   59,   59,   59,   59,   59,    0,   59,
   59,   59,   60,    0,   60,   60,    0,   43,    0,    0,
   60,   60,   60,   60,   60,   60,    0,   60,   60,   60,
   60,   60,   60,   60,   60,   60,    0,   60,   60,   60,
    0,   61,    0,   61,   61,    0,    0,    0,    0,   61,
   61,   61,   61,   61,   61,    0,   61,   61,   61,   61,
   61,   61,   61,   61,   61,    0,   61,   61,   61,   62,
    0,   62,   62,    0,    0,    0,    0,   62,   62,   62,
   62,   62,   62,   43,   62,   62,   62,   62,   62,   62,
   62,   62,   62,    0,   62,   62,   62,   63,    0,   63,
   63,    0,    0,    0,    0,   63,   63,   63,   63,   63,
   63,    0,   63,   63,   63,   63,   63,   63,   63,   63,
   63,    0,   63,   63,   63,   64,    0,    0,   64,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
   64,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,   50,    0,    0,   50,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,   50,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   49,    0,    0,   49,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   49,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   64,    0,    0,   67,
    0,    0,   67,    0,    0,    0,    0,    0,    0,    0,
   48,    0,   48,   48,   67,    0,    0,    0,    0,   48,
   48,   48,   48,   48,   50,   48,   48,   48,   48,   48,
   48,   48,   48,   48,    0,   48,   48,   48,   35,   36,
    0,    0,    0,    0,    0,    0,    0,    0,   39,   40,
    0,    0,   49,   42,    0,    0,    0,   48,    0,    0,
    0,    0,   50,    0,    0,    0,    0,    0,    0,    0,
   59,    0,   60,    0,    0,    0,    0,   61,    0,    0,
   67,    0,   90,   91,   92,   93,   94,   95,   96,   97,
   98,   99,  100,  101,  102,  103,  104,  105,  106,  107,
  108,  109,    0,    0,    0,    0,    0,    0,  115,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,  116,
  117,  118,    0,   64,    0,   64,   64,    0,    0,    0,
    0,   64,   64,   64,   64,   64,   64,    0,   64,   64,
   64,   64,   64,   64,   64,   64,   64,    0,   64,   64,
   64,   50,    0,   50,   50,    0,    0,    0,    0,   50,
   50,   50,   50,   50,   50,    0,   50,   50,   50,   50,
   50,   50,   50,   50,   50,    0,   50,   50,   50,   49,
    0,   49,   49,    0,    0,    0,    0,   49,   49,   49,
   49,   49,   49,    0,   49,   49,   49,   49,   49,   49,
   49,   49,   49,    0,   49,   49,   49,   67,    0,   67,
   67,    0,    0,    0,    0,   67,   67,   67,   67,   67,
   67,    0,   67,   67,   67,   67,   67,   67,   67,   67,
   67,    0,   67,   67,   67,   62,   37,    0,    0,    0,
    0,   63,    0,   64,   65,    0,    0,    0,    0,    0,
   66,   67,   68,   69,   70,    0,   71,   72,   73,   74,
   75,   76,   77,   78,   79,    0,   80,   81,   82,   63,
    0,   64,   65,    0,    0,    0,    0,    0,   66,   67,
   68,   69,   70,    0,   71,   72,   73,   74,   75,   76,
   77,   78,   79,    0,   80,   81,   82,   47,    0,   47,
   47,    0,    0,    0,    0,    0,   47,   47,   47,   47,
   47,    0,   47,   47,   47,   47,   47,   47,   47,   47,
   47,    0,   47,   47,   47,   46,    0,   46,   46,    0,
    0,    0,    0,    0,   46,   46,   46,   46,   46,    0,
   46,   46,   46,   46,   46,   46,   46,   46,   46,    0,
   46,   46,   46,
};
short yycheck[] = {                                      44,
   42,   61,   47,   93,   46,   44,   13,   17,   47,   59,
   43,   44,   44,   59,   59,   44,   58,   44,  257,  257,
   27,   31,   46,  262,  257,  264,  264,   44,   42,   62,
   47,  264,   46,   93,   58,  264,  125,  264,   43,   44,
  257,    0,   59,   58,   58,   43,   44,    0,  113,   91,
   58,   14,   42,   36,   60,   44,   42,   62,   47,   -1,
   46,   -1,   -1,   -1,   62,   -1,   43,   91,   -1,   -1,
   59,   -1,   58,   43,   44,  125,   -1,   91,   -1,  125,
  125,   -1,   -1,   44,   42,   62,   47,   -1,   46,   -1,
  123,  123,   62,   -1,  123,   -1,  123,   -1,   59,   -1,
   58,   -1,   -1,   -1,   -1,   91,   -1,   -1,  125,   -1,
   -1,   44,   -1,   -1,   47,   -1,   -1,   -1,  123,   -1,
   -1,   -1,   -1,   -1,   -1,  123,   59,   -1,   -1,   -1,
   -1,   -1,   -1,   91,   -1,   -1,  125,   -1,   -1,   -1,
   44,   -1,   42,   47,   -1,   -1,   46,   -1,   -1,   -1,
   -1,   -1,   -1,  123,   -1,   59,   -1,   -1,   58,   -1,
   -1,   -1,   -1,   -1,  125,   -1,   -1,  257,   44,   -1,
   -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   59,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   91,  125,   -1,   -1,   -1,   44,  257,   -1,   47,
  260,  261,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   59,   -1,   -1,  256,   -1,   -1,  262,   -1,  264,
  265,  125,  264,  265,  257,  270,  271,  272,  273,  274,
  275,  270,  277,  278,  279,  280,  281,  282,  283,  284,
  285,  265,  287,  288,  289,  262,   -1,  264,  265,  125,
  264,  265,  257,  270,  271,  272,  273,  274,  275,  257,
  277,  278,  279,  280,  281,  282,  283,  284,  285,   -1,
  287,  288,  289,  262,   -1,  264,  265,  125,  264,  265,
  257,  270,  271,  272,  273,  274,  275,  257,  277,  278,
  279,  280,  281,  282,  283,  284,  285,   -1,  287,  288,
  289,  262,   -1,  264,  265,   -1,  264,  265,   -1,  270,
  271,  272,  273,  274,  275,   -1,  277,  278,  279,  280,
  281,  282,  283,  284,  285,   -1,  287,  288,  289,  262,
   -1,  264,  265,   -1,   -1,   -1,   -1,  270,  271,  272,
  273,  274,  275,   -1,  277,  278,  279,  280,  281,  282,
  283,  284,  285,   -1,  287,  288,  289,  257,  262,   -1,
  264,  265,   -1,   -1,  264,  265,  270,  271,  272,  273,
  274,  275,   -1,  277,  278,  279,  280,  281,  282,  283,
  284,  285,   -1,  287,  288,  289,  262,   -1,  264,  265,
   -1,   -1,   -1,   -1,  270,  271,  272,  273,  274,  275,
   -1,  277,  278,  279,  280,  281,  282,  283,  284,  285,
   -1,  287,  288,  289,  262,   -1,  264,  265,   -1,   -1,
   -1,   -1,  270,  271,  272,  273,  274,  275,   -1,  277,
  278,  279,  280,  281,  282,  283,  284,  285,   -1,  287,
  288,  289,   44,   -1,   -1,   47,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   59,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   44,   -1,   -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   59,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   44,   -1,
   -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   59,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,  125,   -1,   -1,   44,   -1,   -1,   47,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   59,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,  125,   -1,   -1,   44,   -1,   -1,   47,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   59,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  125,
   -1,   -1,   -1,   44,   -1,   -1,   47,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   59,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,  125,   -1,   -1,
   -1,   44,   -1,   -1,   47,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   59,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,  125,   -1,   -1,   -1,   44,
   -1,   -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   59,   -1,   -1,   -1,   -1,   -1,
  262,   -1,  264,  265,  125,   -1,   -1,   -1,  270,  271,
  272,  273,  274,  275,   -1,  277,  278,  279,  280,  281,
  282,  283,  284,  285,   -1,  287,  288,  289,  262,   -1,
  264,  265,  125,   -1,   -1,   -1,  270,  271,  272,  273,
  274,  275,   -1,  277,  278,  279,  280,  281,  282,  283,
  284,  285,   -1,  287,  288,  289,  262,   -1,  264,  265,
  125,   -1,   -1,   -1,  270,  271,  272,  273,  274,  275,
   -1,  277,  278,  279,  280,  281,  282,  283,  284,  285,
   -1,  287,  288,  289,  262,   -1,  264,  265,   -1,   -1,
   -1,   -1,  270,  271,  272,  273,  274,  275,   -1,  277,
  278,  279,  280,  281,  282,  283,  284,  285,   -1,  287,
  288,  289,  262,   -1,  264,  265,   -1,   59,   -1,   -1,
  270,  271,  272,  273,  274,  275,   -1,  277,  278,  279,
  280,  281,  282,  283,  284,  285,   -1,  287,  288,  289,
   -1,  262,   -1,  264,  265,   -1,   -1,   -1,   -1,  270,
  271,  272,  273,  274,  275,   -1,  277,  278,  279,  280,
  281,  282,  283,  284,  285,   -1,  287,  288,  289,  262,
   -1,  264,  265,   -1,   -1,   -1,   -1,  270,  271,  272,
  273,  274,  275,  125,  277,  278,  279,  280,  281,  282,
  283,  284,  285,   -1,  287,  288,  289,  262,   -1,  264,
  265,   -1,   -1,   -1,   -1,  270,  271,  272,  273,  274,
  275,   -1,  277,  278,  279,  280,  281,  282,  283,  284,
  285,   -1,  287,  288,  289,   44,   -1,   -1,   47,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   59,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   44,   -1,   -1,   47,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   59,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   44,   -1,   -1,   47,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   59,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,  125,   -1,   -1,   44,
   -1,   -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
  262,   -1,  264,  265,   59,   -1,   -1,   -1,   -1,  271,
  272,  273,  274,  275,  125,  277,  278,  279,  280,  281,
  282,  283,  284,  285,   -1,  287,  288,  289,   19,   20,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   29,   30,
   -1,   -1,  125,   34,   -1,   -1,   -1,   38,   -1,   -1,
   -1,   -1,   43,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   51,   -1,   53,   -1,   -1,   -1,   -1,   58,   -1,   -1,
  125,   -1,   63,   64,   65,   66,   67,   68,   69,   70,
   71,   72,   73,   74,   75,   76,   77,   78,   79,   80,
   81,   82,   -1,   -1,   -1,   -1,   -1,   -1,   89,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  110,
  111,  112,   -1,  262,   -1,  264,  265,   -1,   -1,   -1,
   -1,  270,  271,  272,  273,  274,  275,   -1,  277,  278,
  279,  280,  281,  282,  283,  284,  285,   -1,  287,  288,
  289,  262,   -1,  264,  265,   -1,   -1,   -1,   -1,  270,
  271,  272,  273,  274,  275,   -1,  277,  278,  279,  280,
  281,  282,  283,  284,  285,   -1,  287,  288,  289,  262,
   -1,  264,  265,   -1,   -1,   -1,   -1,  270,  271,  272,
  273,  274,  275,   -1,  277,  278,  279,  280,  281,  282,
  283,  284,  285,   -1,  287,  288,  289,  262,   -1,  264,
  265,   -1,   -1,   -1,   -1,  270,  271,  272,  273,  274,
  275,   -1,  277,  278,  279,  280,  281,  282,  283,  284,
  285,   -1,  287,  288,  289,  256,  257,   -1,   -1,   -1,
   -1,  262,   -1,  264,  265,   -1,   -1,   -1,   -1,   -1,
  271,  272,  273,  274,  275,   -1,  277,  278,  279,  280,
  281,  282,  283,  284,  285,   -1,  287,  288,  289,  262,
   -1,  264,  265,   -1,   -1,   -1,   -1,   -1,  271,  272,
  273,  274,  275,   -1,  277,  278,  279,  280,  281,  282,
  283,  284,  285,   -1,  287,  288,  289,  262,   -1,  264,
  265,   -1,   -1,   -1,   -1,   -1,  271,  272,  273,  274,
  275,   -1,  277,  278,  279,  280,  281,  282,  283,  284,
  285,   -1,  287,  288,  289,  262,   -1,  264,  265,   -1,
   -1,   -1,   -1,   -1,  271,  272,  273,  274,  275,   -1,
  277,  278,  279,  280,  281,  282,  283,  284,  285,   -1,
  287,  288,  289,
};
#define YYFINAL 8
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 290
#if YYDEBUG
char *yyname[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,"'*'","'+'","','",0,"'.'","'/'",0,0,0,0,0,0,0,0,0,0,"':'","';'",
0,"'='","'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,
"']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,"S","CDO","CDC","INCLUDES","DASHMATCH","STRING","INVALID",
"IDENT","HASH","IMPORT_SYM","PAGE_SYM","MEDIA_SYM","CHARSET_SYM",
"IMPORTANT_SYM","EMS","EXS","PXS","CMS","MMS","INS","PTS","PCS","DEGS","RADS",
"GRADS","MSECS","SECS","HERZS","KHERZS","DIMENSION","PERCENTAGE","NUMBER","URI",
"FUNCTION",
};
char *yyrule[] = {
"$accept : document",
"document : stylerule_list maybe_space",
"document : error '}'",
"document :",
"stylerule_list : stylerule",
"stylerule_list : stylerule_list maybe_space stylerule",
"stylerule : selector_list_begin maybe_space declaration_list '}'",
"selector_list_begin : selector_list '{'",
"selector_list : selector",
"selector_list : selector_list ',' maybe_space selector",
"combinator : '+' maybe_space",
"combinator : '>' maybe_space",
"selector_with_space : selector S",
"selector : simple_selector",
"selector : selector_with_space",
"selector : selector_with_space simple_selector",
"selector : selector combinator simple_selector",
"simple_selector : element_name",
"simple_selector : element_name specifier_list",
"simple_selector : specifier_list",
"specifier_list : specifier",
"specifier_list : specifier_list specifier",
"specifier : HASH",
"specifier : class",
"specifier : attrib",
"specifier : pseudo",
"element_name : IDENT",
"element_name : '*'",
"class : '.' IDENT",
"pseudo : ':' IDENT",
"attrib : '[' maybe_space IDENT maybe_space ']'",
"attrib : '[' maybe_space IDENT maybe_space match maybe_space ident_or_string maybe_space ']'",
"match : '='",
"match : INCLUDES",
"match : DASHMATCH",
"ident_or_string : IDENT",
"ident_or_string : STRING",
"declaration_list : declaration",
"declaration_list : declaration_list ';' maybe_space declaration",
"declaration : property ':' maybe_space expr prio",
"declaration : property ':' maybe_space error",
"property : IDENT maybe_space",
"prio : IMPORTANT_SYM maybe_space",
"prio :",
"expr : unary_term",
"expr : expr operator unary_term",
"operator : '/' maybe_space",
"operator : ',' maybe_space",
"operator :",
"unary_term : NUMBER maybe_space",
"unary_term : PERCENTAGE maybe_space",
"unary_term : PTS maybe_space",
"unary_term : CMS maybe_space",
"unary_term : MMS maybe_space",
"unary_term : PCS maybe_space",
"unary_term : PXS maybe_space",
"unary_term : EMS maybe_space",
"unary_term : EXS maybe_space",
"unary_term : DEGS maybe_space",
"unary_term : RADS maybe_space",
"unary_term : GRADS maybe_space",
"unary_term : MSECS maybe_space",
"unary_term : SECS maybe_space",
"unary_term : HERZS maybe_space",
"unary_term : KHERZS maybe_space",
"unary_term : STRING maybe_space",
"unary_term : IDENT maybe_space",
"unary_term : URI maybe_space",
"unary_term : hexcolor",
"hexcolor : HASH maybe_space",
"maybe_space :",
"maybe_space : maybe_space S",
};
#endif
#if YYDEBUG
#include <stdio.h>
#endif

/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH  YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 500
#define YYMAXDEPTH  500
#endif
#endif

#define YYINITSTACKSIZE 500

int      yydebug;
int      yynerrs;
int      yyerrflag;
int      yychar;
short   *yyssp;
YYSTYPE *yyvsp;
YYSTYPE  yyval;
YYSTYPE  yylval;

/* variables for the parser stack */
static short   *yyss;
static short   *yysslim;
static YYSTYPE *yyvs;
static int      yystacksize;
#line 579 "./CSSParser/src/CSSGrammer.ypp"

void yyerror(const char* error_str)
{
	fprintf(stderr, "parser error:%s\n", error_str);
}
#line 585 "./CSSParser/src/CSSGrammer.cc"
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
static int yygrowstack(void)
{
    int newsize, i;
    short *newss;
    YYSTYPE *newvs;

    if ((newsize = yystacksize) == 0)
        newsize = YYINITSTACKSIZE;
    else if (newsize >= YYMAXDEPTH)
        return -1;
    else if ((newsize *= 2) > YYMAXDEPTH)
        newsize = YYMAXDEPTH;

    i = yyssp - yyss;
    newss = (yyss != 0)
          ? (short *)realloc(yyss, newsize * sizeof(*newss))
          : (short *)malloc(newsize * sizeof(*newss));
    if (newss == 0)
        return -1;

    yyss  = newss;
    yyssp = newss + i;
    newvs = (yyvs != 0)
          ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs))
          : (YYSTYPE *)malloc(newsize * sizeof(*newvs));
    if (newvs == 0)
        return -1;

    yyvs = newvs;
    yyvsp = newvs + i;
    yystacksize = newsize;
    yysslim = yyss + newsize - 1;
    return 0;
}

#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse(void)
{
    register int yym, yyn, yystate;
#if YYDEBUG
    register const char *yys;

    if ((yys = getenv("YYDEBUG")) != 0)
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }
#endif

    yynerrs = 0;
    yyerrflag = 0;
    yychar = YYEMPTY;

    if (yyss == NULL && yygrowstack()) goto yyoverflow;
    yyssp = yyss;
    yyvsp = yyvs;
    *yyssp = yystate = 0;

yyloop:
    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
    if (yychar < 0)
    {
        if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, reading %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
    }
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: state %d, shifting to state %d\n",
                    YYPREFIX, yystate, yytable[yyn]);
#endif
        if (yyssp >= yysslim && yygrowstack())
        {
            goto yyoverflow;
        }
        *++yyssp = yystate = yytable[yyn];
        *++yyvsp = yylval;
        yychar = YYEMPTY;
        if (yyerrflag > 0)  --yyerrflag;
        goto yyloop;
    }
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
        yyn = yytable[yyn];
        goto yyreduce;
    }
    if (yyerrflag) goto yyinrecovery;

    yyerror("syntax error");

#ifdef lint
    goto yyerrlab;
#endif

yyerrlab:
    ++yynerrs;

yyinrecovery:
    if (yyerrflag < 3)
    {
        yyerrflag = 3;
        for (;;)
        {
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: state %d, error recovery shifting\
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
                if (yyssp >= yysslim && yygrowstack())
                {
                    goto yyoverflow;
                }
                *++yyssp = yystate = yytable[yyn];
                *++yyvsp = yylval;
                goto yyloop;
            }
            else
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: error recovery discarding state %d\n",
                            YYPREFIX, *yyssp);
#endif
                if (yyssp <= yyss) goto yyabort;
                --yyssp;
                --yyvsp;
            }
        }
    }
    else
    {
        if (yychar == 0) goto yyabort;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
        yychar = YYEMPTY;
        goto yyloop;
    }

yyreduce:
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
                YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
    yym = yylen[yyn];
    if (yym)
        yyval = yyvsp[1-yym];
    else
        memset(&yyval, 0, sizeof yyval);
    switch (yyn)
    {
case 1:
#line 116 "./CSSParser/src/CSSGrammer.ypp"
{
		/*printf("get all style rule_list\n");*/
	 }
break;
case 6:
#line 129 "./CSSParser/src/CSSGrammer.ypp"
{
		if(g_DocumentHandler)
			g_DocumentHandler->endSelector(yyvsp[-3].iSelectorList);
	}
break;
case 7:
#line 136 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iSelectorList = yyvsp[-1].iSelectorList;
		if(g_DocumentHandler)
			g_DocumentHandler->startSelector(yyvsp[-1].iSelectorList);
	 }
break;
case 8:
#line 144 "./CSSParser/src/CSSGrammer.ypp"
{
		SelectorListImpl* l_Impl = new SelectorListImpl();
		assert(yyvsp[0].iSelector);
		l_Impl->add(*(yyvsp[0].iSelector));
		delete yyvsp[0].iSelector;
		yyval.iSelectorList = l_Impl;
	 }
break;
case 9:
#line 151 "./CSSParser/src/CSSGrammer.ypp"
{
		assert(yyvsp[0].iSelector);
		(static_cast<SelectorListImpl*>(yyvsp[-3].iSelectorList))->add(*(yyvsp[0].iSelector));
		delete yyvsp[0].iSelector;
		yyval.iSelectorList = yyvsp[-3].iSelectorList;
	}
break;
case 10:
#line 160 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)'+';
	  }
break;
case 11:
#line 163 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)'>';
	  }
break;
case 12:
#line 169 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iSelector = yyvsp[-1].iSelector;
	  }
break;
case 13:
#line 175 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iSelector = yyvsp[0].iSelector;
	 }
break;
case 14:
#line 178 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iSelector = yyvsp[0].iSelector;
	 }
break;
case 15:
#line 181 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iSelector = g_SelectorFactory->createDescendantSelector(yyvsp[-1].iSelector,
										static_cast<SimpleSelector*>(yyvsp[0].iSelector));
		delete yyvsp[-1].iSelector;
		delete yyvsp[0].iSelector;
	}
break;
case 16:
#line 187 "./CSSParser/src/CSSGrammer.ypp"
{
		switch(yyvsp[-1].int_value)
		{
		case (int)'+':{
						 yyval.iSelector = g_SelectorFactory->createDirectAdjacentSelector(0,
												yyvsp[-2].iSelector, static_cast<SimpleSelector*>(yyvsp[0].iSelector));
						 delete yyvsp[-2].iSelector;
						 delete yyvsp[0].iSelector;
					  } break;
		case (int)'>':{
						 yyval.iSelector = g_SelectorFactory->createChildSelector(yyvsp[-2].iSelector,
												static_cast<SimpleSelector*>(yyvsp[0].iSelector));
						 delete yyvsp[-2].iSelector;
						 delete yyvsp[0].iSelector;
					  } break;
		default:
			assert(0);
		}
	 }
break;
case 17:
#line 209 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iSelector = yyvsp[0].iElement;
	 }
break;
case 18:
#line 212 "./CSSParser/src/CSSGrammer.ypp"
{
		/*printf("element_name specifier_list begin:%d,%d\n", (int)$1, (int)$2);*/
		yyval.iSelector = g_SelectorFactory->createConditionalSelector(yyvsp[-1].iElement, yyvsp[0].iCondition);
		delete yyvsp[-1].iElement;
		delete yyvsp[0].iCondition;
		/*printf("element_name specifier_list end\n");*/
	}
break;
case 19:
#line 219 "./CSSParser/src/CSSGrammer.ypp"
{
		SimpleSelector* p = g_SelectorFactory->createElementSelector(NULL, string(""));
		yyval.iSelector = g_SelectorFactory->createConditionalSelector(p, yyvsp[0].iCondition);
		delete p;
		delete yyvsp[0].iCondition;
	}
break;
case 20:
#line 228 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = yyvsp[0].iCondition;
	 }
break;
case 21:
#line 231 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = g_ConditionFactory->createAndCondition(yyvsp[-1].iCondition, yyvsp[0].iCondition);
		delete yyvsp[-1].iCondition;
		delete yyvsp[0].iCondition;
	}
break;
case 22:
#line 239 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = g_ConditionFactory->createIdCondition(yyvsp[0].text);
	 }
break;
case 23:
#line 242 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = yyvsp[0].iCondition;
	 }
break;
case 24:
#line 245 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = yyvsp[0].iCondition;
	 }
break;
case 25:
#line 248 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = yyvsp[0].iCondition;
	 }
break;
case 26:
#line 254 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iElement = g_SelectorFactory->createElementSelector(NULL, yyvsp[0].text);
		free(yyvsp[0].text);
	 }
break;
case 27:
#line 258 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iElement = g_SelectorFactory->createElementSelector(NULL, string(""));
	 }
break;
case 28:
#line 264 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = g_ConditionFactory->createClassCondition(NULL, yyvsp[0].text);
		free(yyvsp[0].text);
	 }
break;
case 29:
#line 271 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = g_ConditionFactory->createPseudoClassCondition(NULL, yyvsp[0].text);
		free(yyvsp[0].text);
	 }
break;
case 30:
#line 278 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iCondition = g_ConditionFactory->createAttributeCondition(yyvsp[-2].text, NULL, true, string(""));
	 }
break;
case 31:
#line 282 "./CSSParser/src/CSSGrammer.ypp"
{
		switch(yyvsp[-4].int_value)
		{
		case (int)'=' : {
							yyval.iCondition = g_ConditionFactory->createAttributeCondition(string(yyvsp[-6].text), NULL,
													true, yyvsp[-2].text);
						} break;
		case (int)INCLUDES : {
								yyval.iCondition = g_ConditionFactory->createOneOfAttributeCondition(string(yyvsp[-6].text),
															NULL, true, yyvsp[-2].text);
							 } break;
		case (int)DASHMATCH : {
								yyval.iCondition = g_ConditionFactory->createBeginHyphenAttributeCondition(
															yyvsp[-6].text, NULL, true, yyvsp[-2].text);
							  } break;
		default:
			assert(0);

		}
		free(yyvsp[-6].text);
		free(yyvsp[-2].text);
	}
break;
case 32:
#line 307 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)'=';
	 }
break;
case 33:
#line 310 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)INCLUDES;
	}
break;
case 34:
#line 313 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)DASHMATCH;
	}
break;
case 35:
#line 319 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.text = yyvsp[0].text;
	 }
break;
case 36:
#line 322 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.text = yyvsp[0].text;
	 }
break;
case 39:
#line 333 "./CSSParser/src/CSSGrammer.ypp"
{
		/*printf("get decaretion\n");
		printf("%s:", $1);*/
		LexicalUnit* p = yyvsp[-1].iUnit;
		if(g_DocumentHandler)
			g_DocumentHandler->property(string(yyvsp[-4].text), p, yyvsp[0].boolean);
		LexicalUnit* next = NULL;
		while(p)
		{
			next = p->getNextLexicalUnit();
			delete p;
			p = next;
		}
	 }
break;
case 40:
#line 347 "./CSSParser/src/CSSGrammer.ypp"
{
		printf("get an error\n");
	 }
break;
case 41:
#line 353 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.text = yyvsp[-1].text;
	 }
break;
case 42:
#line 359 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.boolean = true;
	 }
break;
case 43:
#line 362 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.boolean = false;
	}
break;
case 44:
#line 368 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = yyvsp[0].iUnit;
	 }
break;
case 45:
#line 371 "./CSSParser/src/CSSGrammer.ypp"
{
		LexicalUnit* p = yyvsp[-2].iUnit;
		LexicalUnit* temp = NULL;
		while((temp = p->getNextLexicalUnit()) != NULL)
			p = temp;

		switch(yyvsp[-1].int_value)
		{
		case (int)'/': {
							static_cast<LexicalUnitImpl*>(p)->setNextLexicalUnit(
												LexicalUnitImpl::createSlash(NULL));
							p = static_cast<LexicalUnitImpl*>(p)->getNextLexicalUnit();
					   } break;
		case (int)',': {
							static_cast<LexicalUnitImpl*>(p)->setNextLexicalUnit(
												LexicalUnitImpl::createSlash(NULL));
							p = static_cast<LexicalUnitImpl*>(p)->getNextLexicalUnit();
					   } break;
		case 0: break;
		default:
			assert(0);
		}
		static_cast<LexicalUnitImpl*>(p)->setNextLexicalUnit(yyvsp[0].iUnit);
		static_cast<LexicalUnitImpl*>(p)->setPreviousLexicalUnit(yyvsp[-2].iUnit);
		yyval.iUnit = yyvsp[-2].iUnit;
	}
break;
case 46:
#line 400 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)'/';
	 }
break;
case 47:
#line 403 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = (int)',';
	}
break;
case 48:
#line 406 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.int_value = 0;
	}
break;
case 49:
#line 412 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createNumber(NULL, yyvsp[-1].float_value);
	 }
break;
case 50:
#line 415 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createPercentage(NULL, yyvsp[-1].float_value);
	}
break;
case 51:
#line 418 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createPixel(NULL, yyvsp[-1].float_value);
	}
break;
case 52:
#line 421 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createCentimeter(NULL ,yyvsp[-1].float_value);
	}
break;
case 53:
#line 424 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createMillimeter(NULL ,yyvsp[-1].float_value);
	}
break;
case 54:
#line 427 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createPica(NULL, yyvsp[-1].float_value);
	}
break;
case 55:
#line 430 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createPixel(NULL, yyvsp[-1].float_value);
	}
break;
case 56:
#line 434 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createEm(NULL, yyvsp[-1].float_value);
	}
break;
case 57:
#line 438 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createEx(NULL, yyvsp[-1].float_value);
	}
break;
case 58:
#line 442 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createDegree(NULL, yyvsp[-1].float_value);
	}
break;
case 59:
#line 446 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createRadian(NULL, yyvsp[-1].float_value);
	}
break;
case 60:
#line 450 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createGradian(NULL, yyvsp[-1].float_value);
	}
break;
case 61:
#line 454 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createMillisecond(NULL, yyvsp[-1].float_value);
	}
break;
case 62:
#line 458 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createSecond(NULL, yyvsp[-1].float_value);
	}
break;
case 63:
#line 462 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createHertz(NULL, yyvsp[-1].float_value);
	}
break;
case 64:
#line 466 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createKiloHertz(NULL, yyvsp[-1].float_value);
	}
break;
case 65:
#line 469 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.iUnit = LexicalUnitImpl::createString(NULL, string(yyvsp[-1].text));
	}
break;
case 66:
#line 472 "./CSSParser/src/CSSGrammer.ypp"
{
		/*printf("unary_term(IDENT)\n");*/
		if(!strcmp(yyvsp[-1].text, "inherit"))
			yyval.iUnit = LexicalUnitImpl::createInherit(NULL);
		else
			yyval.iUnit = LexicalUnitImpl::createIdent(NULL, yyvsp[-1].text);
	}
break;
case 67:
#line 479 "./CSSParser/src/CSSGrammer.ypp"
{
		string sub = string(yyvsp[-1].text).substr(4);
		size_t start = 0;
		size_t length = sub.size();
		bool isString = false;
		for(start = 0; start < length; ++start)
		{
			if(sub[start] == '"' || sub[start] == '\'')
			{
				++start;
				isString = true;
				break;
			}
			if(sub[start] == ' ' || sub[start] == '\t' ||
			   sub[start] == '\f' || sub[start] == '\n')
				continue;
			else
			{
				isString = false;
				break;
			}
		}
		size_t end = start;
		for(end = start+1; end < length; ++end)
		{
			if(isString && (sub[end] == '"' || sub[end] == '\''))
			{
				--end;
				break;
			}
			else if(!isString && (sub[end] == ' ' || sub[end] == '\t' ||
								  sub[end] == '\f' || sub[end] == '\n'))
			{
				--end;
				break;
			}
			else if(sub[end] == ')')
			{
				--end;
				break;
			}
		}
		string realurl = sub.substr(start, end - start + 1);
		yyval.iUnit = LexicalUnitImpl::createURI(NULL, realurl);
	}
break;
case 68:
#line 524 "./CSSParser/src/CSSGrammer.ypp"
{
		string hexstr = string(yyvsp[0].text);
		size_t color_size = hexstr.size();
		if(color_size != 3 && color_size != 6)
			yyval.iUnit = NULL;
		else
		{
			LexicalUnit* params, *first = NULL;
			if(color_size == 3)
			{
				size_t i = 0;
				for(i = 0; i < 3; ++i)
				{
					int value = HexToInt(tolower(hexstr[i]));
					if(i == 0)
						first = params = LexicalUnitImpl::createNumber(NULL, value);
					else
						params = LexicalUnitImpl::createNumber(params, value);
					if(i != 2)
						params = LexicalUnitImpl::createComma(params);
				}
			}
			else
			{
				size_t j = 0;
				for(j = 0 ; j < 3; ++j)
				{
					int value6 = 16*HexToInt(tolower(hexstr[2*j])) +
								 HexToInt(tolower(hexstr[2*j + 1]));
					if(j == 0)
						first = params = LexicalUnitImpl::createNumber(NULL, value6);
					else
						params = LexicalUnitImpl::createNumber(params, value6);
					if(j != 2)
						params = LexicalUnitImpl::createComma(params);
				}
			}
			yyval.iUnit = LexicalUnitImpl::createRgbColor(NULL,first);
		}
		free(yyvsp[0].text);
	}
break;
case 69:
#line 568 "./CSSParser/src/CSSGrammer.ypp"
{
		yyval.text = yyvsp[-1].text;
	 }
break;
#line 1322 "./CSSParser/src/CSSGrammer.cc"
    }
    yyssp -= yym;
    yystate = *yyssp;
    yyvsp -= yym;
    yym = yylhs[yyn];
    if (yystate == 0 && yym == 0)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: after reduction, shifting from state 0 to\
 state %d\n", YYPREFIX, YYFINAL);
#endif
        yystate = YYFINAL;
        *++yyssp = YYFINAL;
        *++yyvsp = yyval;
        if (yychar < 0)
        {
            if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
            if (yydebug)
            {
                yys = 0;
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
                if (!yys) yys = "illegal-symbol";
                printf("%sdebug: state %d, reading %d (%s)\n",
                        YYPREFIX, YYFINAL, yychar, yys);
            }
#endif
        }
        if (yychar == 0) goto yyaccept;
        goto yyloop;
    }
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn];
    else
        yystate = yydgoto[yym];
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yyssp, yystate);
#endif
    if (yyssp >= yysslim && yygrowstack())
    {
        goto yyoverflow;
    }
    *++yyssp = yystate;
    *++yyvsp = yyval;
    goto yyloop;

yyoverflow:
    yyerror("yacc stack overflow");

yyabort:
    return (1);

yyaccept:
    return (0);
}
